Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[optimizer] extract plugin discovery #14745

Merged
merged 78 commits into from
Dec 6, 2017

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Nov 2, 2017

In order to eventually remove the optimizer from the Kibana server we need access to the plugin list, their ui exports, and their metadata outside of the server.

This accomplishes that by extracting the plugin scanning/loading and uiExport collection to a new module called "plugin discovery" ™️. This module exports two functions:

  • findPluginSpecs(settings): Array<PluginSpec>
    • Find the specifications for the plugins based on a Kibana server settings object
  • reduceExportSpecs(pluginSpecs, reducers, defaults)
    • Produces and merges the exports from all plugins, this powers collectUiExports, in the ui module

The UI module has been refactored to use these PluginSpecs via a new method:

  • collectUiExports(pluginSpecs)
    • applies defaults to the reduceExportSpecs() function to produce an object that describes all uiExports exported by the pluginSpecs

@spalger spalger added the WIP Work in progress label Nov 2, 2017
@spalger spalger added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc review v6.1.0 v7.0.0 and removed WIP Work in progress labels Nov 3, 2017
if (!isVersionCompatible(pluginVersion, kibanaVersion)) {
const message = `Plugin "${name}" was disabled because it expected Kibana version "${pluginVersion}", and found "${kibanaVersion}".`;
warningMessages.add(message);
plugins.disable(plugin);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work right now, we need to be able to determine this via plugin discovery

Copy link
Contributor

@kimjoar kimjoar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ❤️ this change — great work!

I didn't have any architectural suggestions or anything like that, so I added some low-level comments and a couple nitpicks (the high-level flow of this looks great imo).

Looks like Timelion fails to start with this error:

Fatal Error

Uncaught Error: [$injector:modulerr] Failed to instantiate module kibana due to: Error: [$injector:modulerr] Failed to instantiate module discover/saved_searches due to: Error: [$injector:modulerr] Failed to instantiate module kibana/courier due to: Error: [$injector:nomod] Module 'kibana/courier' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.6.5/$injector/nomod?p0=kibana%2Fcourier at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40249:12 at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:42430:17 at ensure (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:42351:38) at module (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:42428:14) at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45066:22 at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20) at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5) at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45068:40 at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20) at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5) http://errors.angularjs.org/1.6.5/$injector/modulerr?p0=kibana%2Fcourier&p1=Error%3A%20%5B%24injector%3Anomod%5D%20Module%20'kibana%2Fcourier'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.5%2F%24injector%2Fnomod%3Fp0%3Dkibana%252Fcourier%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40249%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42430%3A17%0A%20%20%20%20at%20ensure%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42351%3A38)%0A%20%20%20%20at%20module%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42428%3A14)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45066%3A22%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5) at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40249:12 at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45090:15 at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20) at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5) at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45068:40 at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20) at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5) at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45068:40 at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20) at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5) http://errors.angularjs.org/1.6.5/$injector/modulerr?p0=discover%2Fsaved_searches&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20kibana%2Fcourier%20due%20to%3A%0AError%3A%20%5B%24injector%3Anomod%5D%20Module%20'kibana%2Fcourier'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.5%2F%24injector%2Fnomod%3Fp0%3Dkibana%252Fcourier%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40249%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42430%3A17%0A%20%20%20%20at%20ensure%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42351%3A38)%0A%20%20%20%20at%20module%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42428%3A14)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45066%3A22%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.5%2F%24injector%2Fmodulerr%3Fp0%3Dkibana%252Fcourier%26p1%3DError%253A%2520%255B%2524injector%253Anomod%255D%2520Module%2520'kibana%252Fcourier'%2520is%2520not%2520available!%2520You%2520either%2520misspelled%2520the%2520module%2520name%2520or%2520forgot%2520to%2520load%2520it.%2520If%2520registering%2520a%2520module%2520ensure%2520that%2520you%2520specify%2520the%2520dependencies%2520as%2520the%2520second%2520argument.%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.6.5%252F%2524injector%252Fnomod%253Fp0%253Dkibana%25252Fcourier%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40249%253A12%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42430%253A17%250A%2520%2520%2520%2520at%2520ensure%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42351%253A38)%250A%2520%2520%2520%2520at%2520module%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42428%253A14)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45066%253A22%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45068%253A40%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40249%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45090%3A15%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5) at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40249:12 at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45090:15 at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20) at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5) at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45068:40 at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20) at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5) at createInjector (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:44972:19) at doBootstrap (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:42082:20) at Object.bootstrap (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:42103:12) http://errors.angularjs.org/1.6.5/$injector/modulerr?p0=kibana&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20discover%2Fsaved_searches%20due%20to%3A%0AError%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20kibana%2Fcourier%20due%20to%3A%0AError%3A%20%5B%24injector%3Anomod%5D%20Module%20'kibana%2Fcourier'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.5%2F%24injector%2Fnomod%3Fp0%3Dkibana%252Fcourier%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40249%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42430%3A17%0A%20%20%20%20at%20ensure%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42351%3A38)%0A%20%20%20%20at%20module%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42428%3A14)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45066%3A22%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.5%2F%24injector%2Fmodulerr%3Fp0%3Dkibana%252Fcourier%26p1%3DError%253A%2520%255B%2524injector%253Anomod%255D%2520Module%2520'kibana%252Fcourier'%2520is%2520not%2520available!%2520You%2520either%2520misspelled%2520the%2520module%2520name%2520or%2520forgot%2520to%2520load%2520it.%2520If%2520registering%2520a%2520module%2520ensure%2520that%2520you%2520specify%2520the%2520dependencies%2520as%2520the%2520second%2520argument.%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.6.5%252F%2524injector%252Fnomod%253Fp0%253Dkibana%25252Fcourier%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40249%253A12%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42430%253A17%250A%2520%2520%2520%2520at%2520ensure%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42351%253A38)%250A%2520%2520%2520%2520at%2520module%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42428%253A14)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45066%253A22%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45068%253A40%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40249%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45090%3A15%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.5%2F%24injector%2Fmodulerr%3Fp0%3Ddiscover%252Fsaved_searches%26p1%3DError%253A%2520%255B%2524injector%253Amodulerr%255D%2520Failed%2520to%2520instantiate%2520module%2520kibana%252Fcourier%2520due%2520to%253A%250AError%253A%2520%255B%2524injector%253Anomod%255D%2520Module%2520'kibana%252Fcourier'%2520is%2520not%2520available!%2520You%2520either%2520misspelled%2520the%2520module%2520name%2520or%2520forgot%2520to%2520load%2520it.%2520If%2520registering%2520a%2520module%2520ensure%2520that%2520you%2520specify%2520the%2520dependencies%2520as%2520the%2520second%2520argument.%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.6.5%252F%2524injector%252Fnomod%253Fp0%253Dkibana%25252Fcourier%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40249%253A12%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42430%253A17%250A%2520%2520%2520%2520at%2520ensure%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42351%253A38)%250A%2520%2520%2520%2520at%2520module%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42428%253A14)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45066%253A22%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45068%253A40%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.6.5%252F%2524injector%252Fmodulerr%253Fp0%253Dkibana%25252Fcourier%2526p1%253DError%25253A%252520%25255B%252524injector%25253Anomod%25255D%252520Module%252520'kibana%25252Fcourier'%252520is%252520not%252520available!%252520You%252520either%252520misspelled%252520the%252520module%252520name%252520or%252520forgot%252520to%252520load%252520it.%252520If%252520registering%252520a%252520module%252520ensure%252520that%252520you%252520specify%252520the%252520dependencies%252520as%252520the%252520second%252520argument.%25250Ahttp%25253A%25252F%25252Ferrors.angularjs.org%25252F1.6.5%25252F%252524injector%25252Fnomod%25253Fp0%25253Dkibana%2525252Fcourier%25250A%252520%252520%252520%252520at%252520http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A40249%25253A12%25250A%252520%252520%252520%252520at%252520http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A42430%25253A17%25250A%252520%252520%252520%252520at%252520ensure%252520(http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A42351%25253A38)%25250A%252520%252520%252520%252520at%252520module%252520(http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A42428%25253A14)%25250A%252520%252520%252520%252520at%252520http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A45066%25253A22%25250A%252520%252520%252520%252520at%252520forEach%252520(http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A40543%25253A20)%25250A%252520%252520%252520%252520at%252520loadModules%252520(http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A45050%25253A5)%25250A%252520%252520%252520%252520at%252520http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A45068%25253A40%25250A%252520%252520%252520%252520at%252520forEach%252520(http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A40543%25253A20)%25250A%252520%252520%252520%252520at%252520loadModules%252520(http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A45050%25253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40249%253A12%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45090%253A15%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45068%253A40%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45068%253A40%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40249%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45090%3A15%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20createInjector%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A44972%3A19)%0A%20%20%20%20at%20doBootstrap%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42082%3A20)%0A%20%20%20%20at%20Object.bootstrap%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42103%3A12) (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45090)
Version: 7.0.0-alpha1
Build: 8467
Error: Uncaught Error: [$injector:modulerr] Failed to instantiate module kibana due to:
Error: [$injector:modulerr] Failed to instantiate module discover/saved_searches due to:
Error: [$injector:modulerr] Failed to instantiate module kibana/courier due to:
Error: [$injector:nomod] Module 'kibana/courier' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.6.5/$injector/nomod?p0=kibana%2Fcourier
    at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40249:12
    at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:42430:17
    at ensure (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:42351:38)
    at module (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:42428:14)
    at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45066:22
    at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20)
    at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5)
    at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45068:40
    at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20)
    at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5)
http://errors.angularjs.org/1.6.5/$injector/modulerr?p0=kibana%2Fcourier&p1=Error%3A%20%5B%24injector%3Anomod%5D%20Module%20'kibana%2Fcourier'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.5%2F%24injector%2Fnomod%3Fp0%3Dkibana%252Fcourier%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40249%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42430%3A17%0A%20%20%20%20at%20ensure%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42351%3A38)%0A%20%20%20%20at%20module%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42428%3A14)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45066%3A22%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)
    at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40249:12
    at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45090:15
    at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20)
    at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5)
    at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45068:40
    at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20)
    at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5)
    at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45068:40
    at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20)
    at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5)
http://errors.angularjs.org/1.6.5/$injector/modulerr?p0=discover%2Fsaved_searches&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20kibana%2Fcourier%20due%20to%3A%0AError%3A%20%5B%24injector%3Anomod%5D%20Module%20'kibana%2Fcourier'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.5%2F%24injector%2Fnomod%3Fp0%3Dkibana%252Fcourier%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40249%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42430%3A17%0A%20%20%20%20at%20ensure%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42351%3A38)%0A%20%20%20%20at%20module%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42428%3A14)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45066%3A22%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.5%2F%24injector%2Fmodulerr%3Fp0%3Dkibana%252Fcourier%26p1%3DError%253A%2520%255B%2524injector%253Anomod%255D%2520Module%2520'kibana%252Fcourier'%2520is%2520not%2520available!%2520You%2520either%2520misspelled%2520the%2520module%2520name%2520or%2520forgot%2520to%2520load%2520it.%2520If%2520registering%2520a%2520module%2520ensure%2520that%2520you%2520specify%2520the%2520dependencies%2520as%2520the%2520second%2520argument.%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.6.5%252F%2524injector%252Fnomod%253Fp0%253Dkibana%25252Fcourier%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40249%253A12%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42430%253A17%250A%2520%2520%2520%2520at%2520ensure%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42351%253A38)%250A%2520%2520%2520%2520at%2520module%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42428%253A14)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45066%253A22%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45068%253A40%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40249%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45090%3A15%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)
    at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40249:12
    at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45090:15
    at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20)
    at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5)
    at http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45068:40
    at forEach (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:40543:20)
    at loadModules (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45050:5)
    at createInjector (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:44972:19)
    at doBootstrap (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:42082:20)
    at Object.bootstrap (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:42103:12)
http://errors.angularjs.org/1.6.5/$injector/modulerr?p0=kibana&p1=Error%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20discover%2Fsaved_searches%20due%20to%3A%0AError%3A%20%5B%24injector%3Amodulerr%5D%20Failed%20to%20instantiate%20module%20kibana%2Fcourier%20due%20to%3A%0AError%3A%20%5B%24injector%3Anomod%5D%20Module%20'kibana%2Fcourier'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.5%2F%24injector%2Fnomod%3Fp0%3Dkibana%252Fcourier%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40249%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42430%3A17%0A%20%20%20%20at%20ensure%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42351%3A38)%0A%20%20%20%20at%20module%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42428%3A14)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45066%3A22%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.5%2F%24injector%2Fmodulerr%3Fp0%3Dkibana%252Fcourier%26p1%3DError%253A%2520%255B%2524injector%253Anomod%255D%2520Module%2520'kibana%252Fcourier'%2520is%2520not%2520available!%2520You%2520either%2520misspelled%2520the%2520module%2520name%2520or%2520forgot%2520to%2520load%2520it.%2520If%2520registering%2520a%2520module%2520ensure%2520that%2520you%2520specify%2520the%2520dependencies%2520as%2520the%2520second%2520argument.%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.6.5%252F%2524injector%252Fnomod%253Fp0%253Dkibana%25252Fcourier%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40249%253A12%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42430%253A17%250A%2520%2520%2520%2520at%2520ensure%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42351%253A38)%250A%2520%2520%2520%2520at%2520module%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42428%253A14)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45066%253A22%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45068%253A40%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40249%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45090%3A15%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.6.5%2F%24injector%2Fmodulerr%3Fp0%3Ddiscover%252Fsaved_searches%26p1%3DError%253A%2520%255B%2524injector%253Amodulerr%255D%2520Failed%2520to%2520instantiate%2520module%2520kibana%252Fcourier%2520due%2520to%253A%250AError%253A%2520%255B%2524injector%253Anomod%255D%2520Module%2520'kibana%252Fcourier'%2520is%2520not%2520available!%2520You%2520either%2520misspelled%2520the%2520module%2520name%2520or%2520forgot%2520to%2520load%2520it.%2520If%2520registering%2520a%2520module%2520ensure%2520that%2520you%2520specify%2520the%2520dependencies%2520as%2520the%2520second%2520argument.%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.6.5%252F%2524injector%252Fnomod%253Fp0%253Dkibana%25252Fcourier%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40249%253A12%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42430%253A17%250A%2520%2520%2520%2520at%2520ensure%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42351%253A38)%250A%2520%2520%2520%2520at%2520module%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A42428%253A14)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45066%253A22%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45068%253A40%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%250Ahttp%253A%252F%252Ferrors.angularjs.org%252F1.6.5%252F%2524injector%252Fmodulerr%253Fp0%253Dkibana%25252Fcourier%2526p1%253DError%25253A%252520%25255B%252524injector%25253Anomod%25255D%252520Module%252520'kibana%25252Fcourier'%252520is%252520not%252520available!%252520You%252520either%252520misspelled%252520the%252520module%252520name%252520or%252520forgot%252520to%252520load%252520it.%252520If%252520registering%252520a%252520module%252520ensure%252520that%252520you%252520specify%252520the%252520dependencies%252520as%252520the%252520second%252520argument.%25250Ahttp%25253A%25252F%25252Ferrors.angularjs.org%25252F1.6.5%25252F%252524injector%25252Fnomod%25253Fp0%25253Dkibana%2525252Fcourier%25250A%252520%252520%252520%252520at%252520http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A40249%25253A12%25250A%252520%252520%252520%252520at%252520http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A42430%25253A17%25250A%252520%252520%252520%252520at%252520ensure%252520(http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A42351%25253A38)%25250A%252520%252520%252520%252520at%252520module%252520(http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A42428%25253A14)%25250A%252520%252520%252520%252520at%252520http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A45066%25253A22%25250A%252520%252520%252520%252520at%252520forEach%252520(http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A40543%25253A20)%25250A%252520%252520%252520%252520at%252520loadModules%252520(http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A45050%25253A5)%25250A%252520%252520%252520%252520at%252520http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A45068%25253A40%25250A%252520%252520%252520%252520at%252520forEach%252520(http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A40543%25253A20)%25250A%252520%252520%252520%252520at%252520loadModules%252520(http%25253A%25252F%25252Flocalhost%25253A5601%25252Fdpm%25252Fbundles%25252Fcommons.bundle.js%25253Fv%25253D8467%25253A45050%25253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40249%253A12%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45090%253A15%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45068%253A40%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%250A%2520%2520%2520%2520at%2520http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45068%253A40%250A%2520%2520%2520%2520at%2520forEach%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A40543%253A20)%250A%2520%2520%2520%2520at%2520loadModules%2520(http%253A%252F%252Flocalhost%253A5601%252Fdpm%252Fbundles%252Fcommons.bundle.js%253Fv%253D8467%253A45050%253A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40249%3A12%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45090%3A15%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45068%3A40%0A%20%20%20%20at%20forEach%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A40543%3A20)%0A%20%20%20%20at%20loadModules%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A45050%3A5)%0A%20%20%20%20at%20createInjector%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A44972%3A19)%0A%20%20%20%20at%20doBootstrap%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42082%3A20)%0A%20%20%20%20at%20Object.bootstrap%20(http%3A%2F%2Flocalhost%3A5601%2Fdpm%2Fbundles%2Fcommons.bundle.js%3Fv%3D8467%3A42103%3A12) (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:45090)
    at window.onerror (http://localhost:5601/dpm/bundles/commons.bundle.js?v=8467:86940:16)

And xpack master didn't start for me with this change.

I commented on a couple things that didn't seem relevant to the PR. Those changes lgtm, but for future large PRs I'd prefer them being in separate PRs (it makes the review process simpler).

@@ -52,21 +50,15 @@ export default class KbnServer {
pidMixin,

// find plugins and set this.plugins
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nitpick, just an addition to the comment for "grep-ability".

// find plugins and set this.plugins and this.pluginSpecs


const specs = [].concat(specsByType[type] || []);

return specs.reduce((acc, spec) => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three levels of acc in here. It's not necessarily a bad thing, it just makes it a bit more difficult to follow the flow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ok.. A lot of times this is how it works when you need to reduce within a reduce within a reduce. Am I just used to that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm used to it, though I do wish it wasn't as messy. I think I prefer this to defining the functions outside of the reduce as function definitions or something. I like how you can see the hierarchy here, but if they were all predefined it would be more confusing to see the relationship.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Works for me

return types.reduce((acc, type) => {
const reducer = (reducers[type] || reducers.unknown);

if (!reducer) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this ever be true, given the || reducers.unknown?

Copy link
Contributor Author

@spalger spalger Nov 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, reducers.unknown might not be defined. Depends on the reducer map passed in


async function statTest(path, test) {
try {
const stats = await fcb(cb => stat(path, cb));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Could this use promisify instead? Then we could have const stats = await statAsync(path) instead, and have const statAsync = promisify(stat) below the imports. Would make it easier to get rid of bluebird when moving to Node 8 that has built-in promisify.

Copy link
Contributor Author

@spalger spalger Nov 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it bug you when the stat function is imported "globally" into the module but only the wrapped statAsync function is "unusable"? I really like the fcb pattern because it allows me to use the actual function rather than aliasing it to xyzAsync in every file. https://github.com/spalger/fcb

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One reason I like promisify is that it is the pattern Node went for in core (with util.promisify). Also, re every file: You either do fcb(...) or promisify(...) in every file, so I don't feel that's a difference. I'm fine with keeping it, though.

Copy link
Contributor Author

@spalger spalger Nov 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the aliasing that's different, not the import/using in every file. Though, in other projects, I've created adapters for libs like fs so that they are promisified in one place and reused all over which has been really nice, except that it means you're using a non-standard lib for something as basic as file access.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it as-is 👍

const { uiAppSpecs = [] } = kbnServer.uiExports;
const existingIds = new Set();

kbnServer.uiApps = uiAppSpecs.map(spec => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: If kbnServer.uiApps was a Map instead of an array, you could remove the need to memoize, and getAllUiApps could return kbnServer.uiAppsByName.values().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also fine just getting rid of the memoize stuff, or indexing the list in a uiAppsById map instead of using memoize(), but I really dislike when lists of things aren't just arrays. Also, Map#values() returns an iterable, but not an array.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

.mergeMap(result => result.enabledSpecs),

// all disabled PluginSpec objects
disabledSpecs$: extendConfig$
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not yet, but I've promised to make that list available so that the list of installed but disabled plugins can be inspected

* - the public directory for this plugin. The final directory must
* have the name "public", though it can be located somewhere besides
* the root of the plugin. Set this to false to disable exposure of a
* public directory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: I think it reads better when we consistently break on 80 lines, plus use the entire newlines for the descriptions (And also remove the unnecessary - from the descriptions).

/**
 * @param {PluginPack} pack The plugin pack that produced this spec
 * @param {Object} opts The options for this plugin
 * @param {String} [opts.id=pkg.name] The id for this plugin.
 * @param {Object} [opts.uiExports] A mapping of UiExport types to UI modules
 * or metadata about the UI module
 * @param {Array} [opts.require] The other plugins that this plugin requires.
 * These plugins must exist and be enabled for this plugin to function. The
 * require'd plugins will also be initialized first, in order to make sure
 * that dependencies provided by these plugins are available.
 * @param {String} [opts.version=pkg.version] The version of this plugin
 * @param {Function} [opts.init] A function that will be called to initialize
 * this plugin at the appropriate time.
 * @param {Function} [opts.configPrefix=this.id] The prefix to use for
 * configuration values in the main configuration service
 * @param {Function} [opts.config] A function that produces a configuration
 * schema using Joi, which is passed as its first argument.
 * @param {String|False} [opts.publicDir=path + '/public'] The public directory
 * for this plugin. The final directory must have the name "public", though it
 * can be located somewhere besides the root of the plugin. Set this to false
 * to disable exposure of a public directory.
 */

This is what it looks like highlighted:

screen shot 2017-11-13 at 13 14 03


const register = (server, options, next) => {
asyncRegister(server, options)
.then(() => next())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what hapi does synchronously on next, but if that function throws an error it would get caught by the catch below, which can create subtle bugs, I think (as we'd call next twice). I think this should be .then(() => next(), next), which would only capture errors from the call to asyncRegister

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, thanks, that's bitten me before (next() totally executed the next hook sync and errors bubble... crazy)

@@ -0,0 +1,28 @@

const queues = new WeakMap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe explain the role of queues? And include why it has to be a WeakMap (compared to just a queue variable). I expect it is because you're expecting multiple different kbnServers?

const read = promisify(require('fs').readFile);
const write = promisify(require('fs').writeFile);
const unlink = promisify(require('fs').unlink);
const stat = promisify(require('fs').stat);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary requires? Could do

import { readFile, writeFile, unlink, stat } from 'fs';

const readFileAsync = promisify(readFile);
// ...

Would be great to avoid require as much as possible imo.

return {
names: [].concat(
acc.names || [],
`${pluginSpec.getId()}:${spec.name}`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we actually need the entire pluginSpec passed in to the reducers?

Copy link
Contributor Author

@spalger spalger Nov 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume no, but doing so means reduceExportSpecs() doesn't need to know what is actually needed by the reducers, which it receives as an argument and doesn't control. It also gives the reducers room to grow.

@epixa
Copy link
Contributor

epixa commented Dec 5, 2017

LGTM

@spalger spalger merged commit c65da14 into elastic:master Dec 6, 2017
spalger added a commit to spalger/kibana that referenced this pull request Dec 6, 2017
* [plugins] extract plugin discover from the kibana server

* integrate plugin discovery module with server

* [pluginDiscovery] fully extend config before checking enabled status

* [pluginDiscovery] limit arbitrary defaults in PluginSpec

* [ui/navLink] fix tests

* [ui/injectedVars] fix tests

* [ui/app] fix tests

* [server/plugins] convert init to callPluginHook tests

* [build/verifyTranslations] update verify logic

* [pluginDiscovery] remove rx utils

* fix i18n transaltion key name

* [pluginDiscovery] do kibana version checks as a part of discovery

* [pluginDiscovery/createPacksInDirectory$] clarify error handling

* [eslint] fix lint errors

* [uiApp/modules] ensure load order matches master

* [uiBundle] use known uiExport type for providers

* [uiExports] use the `home` export type

* [uiExports] validate that all uiExport types are known

* [timelion] remove archaic/broken bwc check

* revert some stragler changes

* [pluginSpecs] reformat comments

* [uiBundle] rebel and use more fcb 😬

* correct comment

* [server/waitForPluginsInit] describe queues var

* [server/plugins] prevent multiple calls to next() by using single then()

* [uiApp] remove archaic deprecation warning

* [uiApp] tighten up tests

* [pluginDiscovery/errors] remove $ from symbol var

* [pluginDiscovery/reduceExportSpecs] update docs

* [pluginDiscovery/findPluginSpecs] rightVersion -> isRightVersion

* [pluginDiscovery/findPluginSpecs] fix typos

* [uiApps/getById] use Map() rather than memoize

* save

* [savedObjects/mappings] use uiExports.savedObjectMappings

* [server/mapping/indexMapping] update tests, addRootProperties method removed

* [uiExports] "embeddableHandlers" -> "embeddableFactories"

* [pluginDiscovery] fix pluralization of invalidVersionSpec$

* [pluginDiscover] add README

* [pluginDiscovery/reduceExportSpecs] don't ignore fasly spec values, just undefined

* [ui/exportTypes] use better reducer names

* [ui/uiExports] add README

* fix links

* [pluginDiscovery/readme] expand examples

* [pluginDiscovery/readme] clean up reduceExportSpecs() doc

* [ui/uiExports/readme] cleanup example

* [pluginDiscovery] remove needless use of lodash

* [pluginDiscovery/waitForComplete] use better name

* [pluginDiscovery/findPluginSpecs] use fixtures rather than core_plugins

* [pluginDiscovery/stubSchema] use deafult: false

* [plguinDiscovery/pluginConfig] add tests

* typo

* [uiExports/readme] fix link

* [pluginDiscovery/packAtPath] fail with InvalidPackError if path is not a string

* [pluginDiscovery/packAtPath] rely on error.code to detect missing package.json file

* [pluginDiscovery/packAtPath] only attempt to get pack when observable is subscribed

* [pluginDiscovery/packAtPath] add tests

* [pluginDiscovery/pluginPack] move absolute path checks into fs lib

* [pluginDiscovery/packsInDirectory] fix error type check

* [pluginDiscovery/pluginPack/tests] share some utils

* [pluginDiscovery/packsInDirectory] add tests

* [pluginDiscovery/pluginPack] only cast undefined to array

* [pluginDiscovery/pluginPack] add tests

* [pluginDiscovery/pluginSpec/isVersionCompatible] add tests

* [pluginDiscovery/InvalidPluginError] be less redundant

* [pluginDiscovery/pluginSpec] verify config service is passed to isEnabled()

* [pluginDiscovery/pluginSpec] add tests

* fix "existent" spelling
spalger added a commit that referenced this pull request Dec 6, 2017
* [optimizer] extract plugin discovery (#14745)

* [plugins] extract plugin discover from the kibana server

* integrate plugin discovery module with server

* [pluginDiscovery] fully extend config before checking enabled status

* [pluginDiscovery] limit arbitrary defaults in PluginSpec

* [ui/navLink] fix tests

* [ui/injectedVars] fix tests

* [ui/app] fix tests

* [server/plugins] convert init to callPluginHook tests

* [build/verifyTranslations] update verify logic

* [pluginDiscovery] remove rx utils

* fix i18n transaltion key name

* [pluginDiscovery] do kibana version checks as a part of discovery

* [pluginDiscovery/createPacksInDirectory$] clarify error handling

* [eslint] fix lint errors

* [uiApp/modules] ensure load order matches master

* [uiBundle] use known uiExport type for providers

* [uiExports] use the `home` export type

* [uiExports] validate that all uiExport types are known

* [timelion] remove archaic/broken bwc check

* revert some stragler changes

* [pluginSpecs] reformat comments

* [uiBundle] rebel and use more fcb 😬

* correct comment

* [server/waitForPluginsInit] describe queues var

* [server/plugins] prevent multiple calls to next() by using single then()

* [uiApp] remove archaic deprecation warning

* [uiApp] tighten up tests

* [pluginDiscovery/errors] remove $ from symbol var

* [pluginDiscovery/reduceExportSpecs] update docs

* [pluginDiscovery/findPluginSpecs] rightVersion -> isRightVersion

* [pluginDiscovery/findPluginSpecs] fix typos

* [uiApps/getById] use Map() rather than memoize

* save

* [savedObjects/mappings] use uiExports.savedObjectMappings

* [server/mapping/indexMapping] update tests, addRootProperties method removed

* [uiExports] "embeddableHandlers" -> "embeddableFactories"

* [pluginDiscovery] fix pluralization of invalidVersionSpec$

* [pluginDiscover] add README

* [pluginDiscovery/reduceExportSpecs] don't ignore fasly spec values, just undefined

* [ui/exportTypes] use better reducer names

* [ui/uiExports] add README

* fix links

* [pluginDiscovery/readme] expand examples

* [pluginDiscovery/readme] clean up reduceExportSpecs() doc

* [ui/uiExports/readme] cleanup example

* [pluginDiscovery] remove needless use of lodash

* [pluginDiscovery/waitForComplete] use better name

* [pluginDiscovery/findPluginSpecs] use fixtures rather than core_plugins

* [pluginDiscovery/stubSchema] use deafult: false

* [plguinDiscovery/pluginConfig] add tests

* typo

* [uiExports/readme] fix link

* [pluginDiscovery/packAtPath] fail with InvalidPackError if path is not a string

* [pluginDiscovery/packAtPath] rely on error.code to detect missing package.json file

* [pluginDiscovery/packAtPath] only attempt to get pack when observable is subscribed

* [pluginDiscovery/packAtPath] add tests

* [pluginDiscovery/pluginPack] move absolute path checks into fs lib

* [pluginDiscovery/packsInDirectory] fix error type check

* [pluginDiscovery/pluginPack/tests] share some utils

* [pluginDiscovery/packsInDirectory] add tests

* [pluginDiscovery/pluginPack] only cast undefined to array

* [pluginDiscovery/pluginPack] add tests

* [pluginDiscovery/pluginSpec/isVersionCompatible] add tests

* [pluginDiscovery/InvalidPluginError] be less redundant

* [pluginDiscovery/pluginSpec] verify config service is passed to isEnabled()

* [pluginDiscovery/pluginSpec] add tests

* fix "existent" spelling

* [server/rootRedirect] fix root_redirect view location
@spalger
Copy link
Contributor Author

spalger commented Dec 6, 2017

6.x/6.2: ea0139b

@spalger spalger deleted the implement/plugin-discovery branch December 6, 2017 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v6.2.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants